The present invention is related generally to the field of computer graphics, and more particularly, a circuit and method for combining graphics data for pixels in a computer graphics processing system.
In graphics processing systems, the color value of each pixel of a graphics image displayed on a monitor must be calculated. The calculated color values for the pixels are then converted into information for the monitor to display the calculated color. For rendering realistic computer graphics images on a display, the calculation of color values for the pixels involves many different factors. These factors include the emissive color of the pixel based on any texture maps applied, the alpha value (i.e., opacity) of the applied texture maps, the intensity and direction of incoming light, the diffuse and specular properties of a surface in which the pixel is located, the orientation and direction the surface is facing with respect to the incoming light, and the position of the viewer with respect to the surface. Although this list of factors is not conclusive, it does illustrate the fact that various factors should be considered when calculating a pixel""s color value.
To facilitate the processing speed necessary to render graphics images seamlessly for applications such as computer animation, many of the processing and calculating of the various factors that are considered in the pixel""s color value calculation are performed in parallel. For example, bilinear interpolation to determine the emissive color value of a pixel may occur in parallel with calculating the diffuse and specular surface properties. Where a pixel""s color value is based on multiple texture maps, the emissive color value is the combination of the applied color values from the texture maps. The resulting color value of the pixel is the combination of the calculated emissive color value, and the diffuse and specular properties.
A combination circuit is typically included in a graphics processing system for the purpose of combining the various factors and calculations used in determining a pixel""s color value. Such a circuit is a texture mapping unit (TMU) as described in U.S. Pat. No. 5,740,343 to Tarolli et al., issued Apr. 14, 1998. Each TMU receives local color and alpha values (Clocal and Alocal) from a respective texture memory to be used in calculating a pixel""s color value and are connected in series to receive a previous TMU""s output color and alpha values (Cin and Ain). The color value output calculated by a TMU is the resultant of a combinational function applied to the two input color values Clocal and Cin and alpha values Alocal and Ain. The TMUs may be programmed to perform various combinational functions, such as calculate the product of a color value of a local texture map and its respective alpha (i.e., opacity) and add the resulting product to the color value output by a previous TMU. Thus, since each TMU in the cascade receives as a local color value the color value of one texture map, a number of textures may be applied to a single pixel by calculating the pixel""s color value through the chain of TMUs.
Although the texture compositing system described in the Tarolli patent allows multiple textures to be applied to calculate the color value of a pixel, it is limited in that the number of textures that may be used in the pixel""s color value calculation is limited to the number of TMUs in the TMU chain. Where it is desirable to apply the color values of a texture map more than once during the pixel""s color value calculation, the respective texture map must be stored in the texture memory of more than one TMU, sacrificing a TMU that could be used for a different texture map. Additionally, complex calculations involving multiple textures must pass through multiple TMUs to generate the resultant color value for a pixel. If the number of calculations necessary to generate the resulting color value exceeds the number of TMUs in the TMU chain, the calculation cannot be performed, and an alternative method of producing the pixel""s color value must be used. Moreover, the calculation performed by each TMU requires one clock cycle to complete. Where calculations to produce the pixel""s color value require calculation through only one TMU, several clock cycles are nevertheless necessary to complete the calculation because the color value must pass through the entire TMU chain, wasting time and computing resources.
Therefore, there is a need for a system and method in a graphics processing system that allows for selectively combining the color values of multiple texture maps and graphics visual characteristics to calculate the color value of a pixel.
The present invention is directed toward a texture combine circuit in a graphics processing system for generating fragment graphics data for a pixel. The texture combine circuit receives graphics data, such as a plurality of texture graphics data, from a texture interpolation circuit and includes at least one texture combine unit coupled to the output terminals of the texture interpolation circuit to receive the plurality of texture graphics data. The texture combine circuit perform graphics combine operations on a set of input data selected from the plurality of texture graphics data to produce the fragment graphics data for the pixel.